﻿/*
 *********************************************************************
 *    Management Extensions for Windows Windows Server AppFabric     *
 *********************************************************************
 *    Author    : Fatih Boy [fatih@enterprisecoding.com]             *
 *    Web site  : http://www.enterprisecoding.com                    *
 *********************************************************************
 *    License   : GNU Library General Public License (LGPL)          * 
 *********************************************************************
 */

using System.Windows.Forms;
using Microsoft.Web.Management.Client;
using Com.Enterprisecoding.AppFabric.Extensions.Client.Resources.Cache;

namespace Com.Enterprisecoding.AppFabric.Extensions.Client.Pages.Cache.Accounts {
    internal sealed class CacheAcccountListViewItem : ListViewItem {
        #region Properties
        public string AccountName { get; set; }
        public AccountType AccountType { get; set; } 
        #endregion

        public CacheAcccountListViewItem(string accountName)
            : base(accountName) {
            AccountName = accountName;

            if (accountName.EndsWith("$")) { //machine accounts ends with '$'
                AccountType = AccountType.MachineAccount;
                base.SubItems.Add(Resources.Cache.CacheAccountsPage.MachineAccountTypeText);
            }
            else {
                AccountType = AccountType.UserAccount;
                base.SubItems.Add(Resources.Cache.CacheAccountsPage.UserAccountTypeText);
            }
        }
    }
}